def reverse_words(sentence):
    # 按空格分割句子为单词列表
    words = sentence.split()
    # 反转单词列表
    reversed_words = words[::-1]
    # 使用空格连接单词列表
    reversed_sentence = ' '.join(reversed_words)
    return reversed_sentence

input_sentence = input("请输入一个句子：")
output_sentence = reverse_words(input_sentence)
print(output_sentence) 